package day1206_1;

public class Bank  extends   Thread{
    Object    lock;
    Bank(Object c){
        lock=c;
    }

    public void run() {
        synchronized (lock) {
            System.out.println(Thread.currentThread().getName() + "取钱");
            try {
                Thread.sleep(5000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("取钱完毕，离开银行...");
        }
    }
}
